<template>
  <div class="top clearfix">
    <div class="file-name">{{(progress|0)==100?'正在处理视频，请稍候……':'上传中，请稍后……'}}</div>
    <div class="progress">
        <progress-bar :progress="progress"></progress-bar>
        <span>已上传:{{(progress.toFixed(2))}}%</span>
    </div>
    <div class="cancel" @click="doCancel"></div>
  </div>
</template>

<script>
import ProgressBar from '../../../../controls/ProgressBar.vue';

export default {
  name: 'videoUploading',
  components:{
    "progress-bar":ProgressBar
  },
  props: ['progress'],
  methods: {
    doCancel(){
      this.$store.dispatch('confirm', '确定要停止上传么？').then(() => {
        this.$store.state.publishMedia.uploader.abort();
        this.$store.dispatch('videoEndUpload', 'standby');
      }, () => {});
    }
  }
};
</script>

<style lang="less">
</style>